<?php 
		
	/* SVN FILE: $Id: opensearch_desc.php 8 2011-03-13 08:32:38Z michele.andreoletti@gmail.com $ */
	
	/**
	* Project Name : arcadia
	*
	* @author $Author: michele.andreoletti@gmail.com $
	* @version $Revision: 8 $
	* @lastrevision $Date: 2011-03-13 08:32:38 +0000 (Sun, 13 Mar 2011) $
	* @filesource $URL: http://arcadia.googlecode.com/svn/trunk/include/opensearch_desc.php $
	*/

	if(isset($_GET['sAPP'])) {
		$sAPP = $_GET['sAPP'];
		
		require_once "../$sAPP/include/const.inc.php";
		require_once "../$sAPP/include/functions.php";
		// require_once "auth.inc.php";
		// require_once "conn.inc.php";
		
		if (isset($bSEARCH_FORM_SHOW) && $bSEARCH_FORM_SHOW) { 
			
			$sOutput  = "<?xml version=\"1.0\"?>";
			$sOutput .= "<OpenSearchDescription xmlns=\"http://a9.com/-/spec/opensearch/1.1/\" xmlns:moz=\"http://www.mozilla.org/2006/browser/search/\">";
				$sOutput .= "<ShortName>$sAPP_NAME</ShortName>";
				$sOutput .= "<Description>$sAPP_NAME</Description>";
				$sOutput .= "<Image height=\"16\" width=\"16\" type=\"image/x-icon\">$sSUITE_URL/themes/common/images/$sFAVICON</Image>";
				$sOutput .= "<Url type=\"text/html\" method=\"get\" template=\"$sSUITE_URL/$sAPP/index.php?sSearchTerms={searchTerms}\" />	";
				$sOutput .= "<Url type=\"application/x-suggestions+json\" method=\"get\" template=\"$sSUITE_URL/include/api.php?sAction=opensearch&amp;sAPP=$sAPP&amp;sSearchTerms={searchTerms}\" />";
				$sOutput .= "<moz:SearchForm>$sSUITE_URL/$sAPP</moz:SearchForm>";
			$sOutput .= "</OpenSearchDescription>";
			
			echo $sOutput;
			
		}
		
	} else  {
		$sAPP = '';
	
	}
	
?>